package com.bestcem.xm.member.controller.param;

import com.alibaba.fastjson.annotation.JSONField;
import com.bestcem.xm.common.core.constant.RegTypes;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 联系人参数扩展字段校验
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/7/16
 */

@Getter
@Setter
public class HttpMemberFieldParam {

    @NotNull(message = "扩展字段id不能为空")
    @Pattern(regexp = RegTypes.OBJECT_ID, message = "扩展字段id格式错误")
    @JsonProperty(value = "field_id")
    @JSONField(name = "field_id")
    private String id;

    @NotNull(message = "扩展字段名称不能为空")
    @JsonProperty(value = "field_name")
    @JSONField(name = "field_name")
    private String name;

    @NotNull(message = "扩展字段类型不能为空")
    @JsonProperty(value = "f_type")
    @JSONField(name = "f_type")
    private Integer type;

    @JsonProperty(value = "field_value")
    @JSONField(name = "field_value")
    private Object value;
}
